package com.boarsoft.boar.demo.order.biz;

import com.boarsoft.boar.demo.user.entity.PocAccount;
import com.boarsoft.boar.demo.order.entity.PocOrder;
import com.boarsoft.common.dao.PagedResult;

/**
 * @ClassName:  OrderBiz   
 * @Description:订单业务
 * @author: 
 * @date:   2019年2月15日 上午9:50:59   
 *     
 * @Copyright: 2019
 */
public interface PocOrderBiz {
	
	/**
	 * @Title: save   
	 * @Description:  保存新订单  
	 * @param:  order
	 * @return: boolean      
	 * @throws
	 */
	public boolean save(PocOrder order);
	
	/**
	 * @Title: update   
	 * @Description:  更新订单  
	 * @param:  order
	 * @return: boolean      
	 * @throws
	 */
	public boolean update(PocOrder order);
	
	/**
	 * @Title: findById   
	 * @Description: 根据id查询订单信息
	 * @param:  orderId
	 * @param:  tenantId
	 * @return: PocOrder      
	 * @throws
	 */
	public PocOrder findById(int tenantId, int orderId);
	
	/**
	 * @Title: placeOrder   
	 * @Description: 下单
	 * @param:  tenantId
	 * @param:  account
	 * @param:  order
	 * @return: boolean      
	 * @throws
	 */
	public boolean placeOrder(PocOrder order);
	
	/**
	 * @Title: payOrder   
	 * @Description: 支付订单
	 * @param:  tenantId
	 * @param:  order
	 * @param:  account
	 * @param:  callType 为true用于测试支付时发生例外的情况
	 * @return: void      
	 * @throws
	 */
	public void payOrder(int tenantId, PocOrder order, PocAccount account, boolean callType) throws Exception;
	
//	/**
//	 * @Title: cancelOrder   
//	 * @Description: 撤单
//	 * @param:  order
//	 * @return: boolean      
//	 * @throws
//	 */
//	public boolean cancelOrder(int tenantId, PocOrder order);
	
	/**
	 * @Title: listByOrderIdAndUserId   
	 * @Description: 查询订单
	 * @param:  tenantId   
	 * @param:  orderId
	 * @param:  userId
	 * @param:  orderBy
	 * @param:  pageNo
	 * @param:  pageSize
	 * @return: PagedResult<PocOrder>      
	 * @throws
	 */
	public PagedResult<PocOrder> listByOrderIdAndUserId(int tenantId, int orderId, int userId, String orderBy, int pageNo, int pageSize);
	
}
